<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>コントロールパネル</title>
    
    <link href="./assets/styles/default.css" rel="stylesheet" />
	<script src="./assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="./assets/scripts/import.js" type="text/javascript"></script>
    
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
	<script src="./assets/scripts/googlemap.js" type="text/javascript"></script>
    
	<script type="text/javascript">
	function uploader_init()
	{
		$('.uploader').unbind('change');
		$('.uploader').change(function(){
				$(this).upload('/web-admin/uploader.php', function(res){
					if (res == ''){
						return false;
					}
					var json = $.parseJSON(res);
					$('#' + json['code']).val(json['cache']);
					$('#preview_' + json['code']).html('<img src="/web-admin/uploader.php?cache=' + json['cache'] + '"/>');
				});
		});
	}
	
	$(document).ready(function(){
		uploader_init();
	});
	
		$(function() {
			back_to_search();
			/*
			$('input["name=forms[class_id]"]').click(function(){
				var r = $(this).val();
				if(r == 1){
					$('.part').show();
				}else {
					$('.part').hide();
				}
			});
			var d = new Date();
			var y = ($('input["name=form[years_y]"]').val() != 0) ? $('input["name=form[years_y]"]').val() : d.getFullYear();
			var m = ($('input["name=form[years_m]"]').val() != 0) ? $('input["name=form[years_m]"]').val() : d.getMonth();
			
			$('input["name=form[years_y]"]').val(y);
			$('input["name=form[years_m]"]').val(m);
			*/
			var map = googlemap({ id:"googlemap",zoom:15,pref:"#pref",address:"#address" });
			$('#setMap').click(function(){
				if($('#pref').val() == '' || $('#address').val() == ''){
					alert('住所を入力してくださ');
					return false;
				}
				map.setMapModal();
			});
			
			$('#status_on a').click(function(){
				customConfirm('地図情報を削除しますか？',"alert",$(this),function(){
					$('#status_on , #status_off').toggle();
					if(!$('#status_off').is(':hidden')){
						$('#lat , #lng').val("");
					}
				});
			});
		});

	</script>
	<style type="text/css">
		.delete_mini { position:relative;top:3px; }
	</style>
    
</head>
<body class="noTranslate">

<header id="dashboard_header">
	<h1>
    	<a href="index.php">コントロールパネル</a>
    </h1>
    <ul>
		<li id="rt_site">
			{assign var=url value='http://investment.bird-i.co.jp'}
			<span><a href="{$url}" target="_blank">サイトを確認</a></span>
		</li>
    	<li id="rt_admin">
    		<a href="javascript:;">
    			{$login.staff_name}
    		</a>
    	</li>
    	<li id="rt_dashboard">
    		<a href="index.php">Dash Board</a>
    	</li>
    	<li id="rt_logout">
    		<form id="form_logout" action="logout.php" method="post">
    			<input type="submit" id="button_logout" value="Logout" />
    		</form>
    	</li>
	</ul>
</header>

<div id="container">
	<aside id="accordion">
    	<div id="aside_inner">
    		{include file=$smarty.const.MENU_FILE}
        </div>
    </aside>
    
    <article>
    	<h2><span>&nbsp;</span>Estate Sale<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>{include file='estate_sale/include/navi.inc.html' active='regist'}</nav>
        
        <section id="content">
			<h3>物件情報{if !isset($forms.id) || $forms.id == ''}登録{else}更新{/if}</h3>
			{if $phase == 'input'}
				<p class="message">内容を確認し、{if !isset($forms.id) || $forms.id == ''}登録{else}更新{/if}ボタンをクリックしてください。</p>
				
				<form name="fm" id="fm_category" action="{$smarty.server.SCRIPT_NAME}" method="post" enctype="multipart/form-data">
                
                    <ul class="t_btns">
                        {if !isset($forms.id) || $forms.id != ''}
                            <li class="left delete"><button type="button" class="chk_delete"><em>&nbsp;</em>削除</button></li>
                            <li class="right refresh"><button type="button" class="chk_update"><em>&nbsp;</em>更新</button></li>
                        {else}
                            <li class="single add"><button type="button" class="chk_add"><em>&nbsp;</em>登録</button></li>
                        {/if}
                    </ul>
                
                    <h4><span>&nbsp;</span>基本情報</h4>
                    {include file='estate_sale/include/form.inc.html'}
                    
                    <h4><span>&nbsp;</span>写真</h4>
                    {include file='estate_sale/include/form_picture.inc.html'}

                    <h4><span>&nbsp;</span>詳細情報</h4>
                    {include file='estate_sale/include/form_detail.inc.html'}
                    	
					<h4><span>&nbsp;</span>公開設定</h4>
					{include file='estate_sale/include/form_control.inc.html'}
			
					<p class="button">
					{if !isset($forms.id) || $forms.id != ''}
						<button type="button" class="btn_del"><span>削除</span></button>
						<button type="button" class="btn_update" class="submit"><span>更新</span></button>
					{else}
						<button type="button" class="btn_regist" class="submit"><span>登録</span></button>
					{/if}
					</p>
					<input type="hidden" name="id" value="{if isset($id)}{$id}{/if}" />
					<input type="hidden" name="do" value="{if !isset($forms.id) || $forms.id == ''}validate_regist_form{else}validate_update_form{/if}"/>
					<input type="hidden" name="mode" value="" />
				</form>
			{/if}
			{if $phase == 'complete'}
				<p class="message">{$message}</p>
				<ul class="result_btn">
					<li><a href="{$smarty.server.SCRIPT_NAME}?op=search">一覧に戻る</a></li>
					<li><a href="{$smarty.server.SCRIPT_NAME}?op=regist">続けて新規登録する</a></li>
                    {if !isset($forms.id) || $forms.id != ''}
						<li><a href="{$smarty.server.SCRIPT_NAME}?op=edit&id={$forms.id}">登録した内容を更新する</a></li>
					{/if}
				</ul>
			{/if}
        </section>
    </article>
</div>

<footer id="dashboard_footer">Copyright (C) SHIFT Inc. / All rights reserved.</footer>

</body>
</html>